﻿//-----------------------------------------------------------------------
// <copyright file="GlyphiconsExtensions.cs" company="deixei.com">
//     Copyright (c) deixei.com. All rights reserved.
// </copyright>
// <author>Marcio Parente</author>
//---------------------------------------------------------------------
namespace Deixei.Web
{
    using Deixei;
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Runtime.CompilerServices;
    using System.Text;
    using System.Web.Mvc;
    using System.Web.Mvc.Html;
    using System.Web.Routing;
    using System.Web.Script.Serialization;

    public static class GlyphiconsExtensions
    {
        public static MvcHtmlString Icon(this HtmlHelper htmlHelper, Icon icon, bool inWhite = false)
        {
            TagBuilder item = new TagBuilder("i");
            item.AddClass(icon.ToCss());
            if ( inWhite )
            {
                item.AddClass("icon-white");
            }
            return item.ToHtmlString();
        }
    }

    public enum Icon
    {
        Glass,
        Music,
        Search,
        Envelope,
        Heart,
        Star,
        StarEmpty,
        User,
        Film,
        ThLarge,
        Th,
        ThList,
        Ok,
        Remove,
        ZoomIn,
        ZoomOut,
        Off,
        Signal,
        Cog,
        Trash,
        Home,
        File,
        Time,
        Road,
        DownloadAlt,
        Download,
        Upload,
        Inbox,
        PlayCircle,
        Repeat,
        Refresh,
        ListAlt,
        Lock,
        Flag,
        Headphones,
        VolumeOff,
        VolumeDown,
        VolumeUp,
        Qrcode,
        Barcode,
        Tag,
        Tags,
        Book,
        Bookmark,
        Print,
        Camera,
        Font,
        Bold,
        Italic,
        TextHeight,
        TextWidth,
        AlignLeft,
        AlignCenter,
        AlignRight,
        AlignJustify,
        List,
        IndentLeft,
        IndentRight,
        FacetimeVideo,
        Picture,
        Pencil,
        MapMarker,
        Adjust,
        Tint,
        Edit,
        Share,
        Check,
        Move,
        StepBackward,
        FastBackward,
        Backward,
        Play,
        Pause,
        Stop,
        Forward,
        FastForward,
        StepForward,
        Eject,
        ChevronLeft,
        ChevronRight,
        PlusSign,
        MinusSign,
        RemoveSign,
        OkSign,
        QuestionSign,
        InfoSign,
        Screenshot,
        RemoveCircle,
        OkCircle,
        BanCircle,
        ArrowLeft,
        ArrowRight,
        ArrowUp,
        ArrowDown,
        ShareAlt,
        ResizeFull,
        ResizeSmall,
        Plus,
        Minus,
        Asterisk,
        ExclamationSign,
        Gift,
        Leaf,
        Fire,
        EyeOpen,
        EyeClose,
        WarningSign,
        Plane,
        Calendar,
        Random,
        Comment,
        Magnet,
        ChevronUp,
        ChevronDown,
        Retweet,
        ShoppingCart,
        FolderClose,
        FolderOpen,
        ResizeVertical,
        ResizeHorizontal,
        Hdd,
        Bullhorn,
        Bell,
        Certificate,
        ThumbsUp,
        ThumbsDown,
        HandRight,
        HandLeft,
        HandUp,
        HandDown,
        CircleArrowRight,
        CircleArrowLeft,
        CircleArrowUp,
        CircleArrowDown,
        Globe,
        Wrench,
        Tasks,
        Filter,
        Briefcase,
        Fullscreen,
        Default
    }



    // Glyphicons 
    public static class IconsConverter
    {

        public static string ToCss(this Icon icon)
        {
            string res;

            switch ( icon )
            {
                case Icon.Glass:
                    res = "icon-glass";
                    break;
                case Icon.Music:
                    res = "icon-music";
                    break;
                case Icon.Search:
                    res = "icon-search";
                    break;
                case Icon.Envelope:
                    res = "icon-envelope";
                    break;
                case Icon.Heart:
                    res = "icon-heart";
                    break;
                case Icon.Star:
                    res = "icon-star";
                    break;
                case Icon.StarEmpty:
                    res = "icon-star-empty";
                    break;
                case Icon.User:
                    res = "icon-user";
                    break;
                case Icon.Film:
                    res = "icon-film";
                    break;
                case Icon.ThLarge:
                    res = "icon-th-large";
                    break;
                case Icon.Th:
                    res = "icon-th";
                    break;
                case Icon.ThList:
                    res = "icon-th-list";
                    break;
                case Icon.Ok:
                    res = "icon-ok";
                    break;
                case Icon.Remove:
                    res = "icon-remove";
                    break;
                case Icon.ZoomIn:
                    res = "icon-zoom-in";
                    break;
                case Icon.ZoomOut:
                    res = "icon-zoom-out";
                    break;
                case Icon.Off:
                    res = "icon-off";
                    break;
                case Icon.Signal:
                    res = "icon-signal";
                    break;
                case Icon.Cog:
                    res = "icon-cog";
                    break;
                case Icon.Trash:
                    res = "icon-trash";
                    break;
                case Icon.Home:
                    res = "icon-home";
                    break;
                case Icon.File:
                    res = "icon-file";
                    break;
                case Icon.Time:
                    res = "icon-time";
                    break;
                case Icon.Road:
                    res = "icon-road";
                    break;
                case Icon.DownloadAlt:
                    res = "icon-download-alt";
                    break;
                case Icon.Download:
                    res = "icon-download";
                    break;
                case Icon.Upload:
                    res = "icon-upload";
                    break;
                case Icon.Inbox:
                    res = "icon-inbox";
                    break;
                case Icon.PlayCircle:
                    res = "icon-play-circle";
                    break;
                case Icon.Repeat:
                    res = "icon-repeat";
                    break;
                case Icon.Refresh:
                    res = "icon-refresh";
                    break;
                case Icon.ListAlt:
                    res = "icon-list-alt";
                    break;
                case Icon.Lock:
                    res = "icon-lock";
                    break;
                case Icon.Flag:
                    res = "icon-flag";
                    break;
                case Icon.Headphones:
                    res = "icon-headphones";
                    break;
                case Icon.VolumeOff:
                    res = "icon-volume-off";
                    break;
                case Icon.VolumeDown:
                    res = "icon-volume-down";
                    break;
                case Icon.VolumeUp:
                    res = "icon-volume-up";
                    break;
                case Icon.Qrcode:
                    res = "icon-qrcode";
                    break;
                case Icon.Barcode:
                    res = "icon-barcode";
                    break;
                case Icon.Tag:
                    res = "icon-tag";
                    break;
                case Icon.Tags:
                    res = "icon-tags";
                    break;
                case Icon.Book:
                    res = "icon-book";
                    break;
                case Icon.Bookmark:
                    res = "icon-bookmark";
                    break;
                case Icon.Print:
                    res = "icon-print";
                    break;
                case Icon.Camera:
                    res = "icon-camera";
                    break;
                case Icon.Font:
                    res = "icon-font";
                    break;
                case Icon.Bold:
                    res = "icon-bold";
                    break;
                case Icon.Italic:
                    res = "icon-italic";
                    break;
                case Icon.TextHeight:
                    res = "icon-text-height";
                    break;
                case Icon.TextWidth:
                    res = "icon-text-width";
                    break;
                case Icon.AlignLeft:
                    res = "icon-align-left";
                    break;
                case Icon.AlignCenter:
                    res = "icon-align-center";
                    break;
                case Icon.AlignRight:
                    res = "icon-align-right";
                    break;
                case Icon.AlignJustify:
                    res = "icon-align-justify";
                    break;
                case Icon.List:
                    res = "icon-list";
                    break;
                case Icon.IndentLeft:
                    res = "icon-indent-left";
                    break;
                case Icon.IndentRight:
                    res = "icon-indent-right";
                    break;
                case Icon.FacetimeVideo:
                    res = "icon-facetime-video";
                    break;
                case Icon.Picture:
                    res = "icon-picture";
                    break;
                case Icon.Pencil:
                    res = "icon-pencil";
                    break;
                case Icon.MapMarker:
                    res = "icon-map-marker";
                    break;
                case Icon.Adjust:
                    res = "icon-adjust";
                    break;
                case Icon.Tint:
                    res = "icon-tint";
                    break;
                case Icon.Edit:
                    res = "icon-edit";
                    break;
                case Icon.Share:
                    res = "icon-share";
                    break;
                case Icon.Check:
                    res = "icon-check";
                    break;
                case Icon.Move:
                    res = "icon-move";
                    break;
                case Icon.StepBackward:
                    res = "icon-step-backward";
                    break;
                case Icon.FastBackward:
                    res = "icon-fast-backward";
                    break;
                case Icon.Backward:
                    res = "icon-backward";
                    break;
                case Icon.Play:
                    res = "icon-play";
                    break;
                case Icon.Pause:
                    res = "icon-pause";
                    break;
                case Icon.Stop:
                    res = "icon-stop";
                    break;
                case Icon.Forward:
                    res = "icon-forward";
                    break;
                case Icon.FastForward:
                    res = "icon-fast-forward";
                    break;
                case Icon.StepForward:
                    res = "icon-step-forward";
                    break;
                case Icon.Eject:
                    res = "icon-eject";
                    break;
                case Icon.ChevronLeft:
                    res = "icon-chevron-left";
                    break;
                case Icon.ChevronRight:
                    res = "icon-chevron-right";
                    break;
                case Icon.PlusSign:
                    res = "icon-plus-sign";
                    break;
                case Icon.MinusSign:
                    res = "icon-minus-sign";
                    break;
                case Icon.RemoveSign:
                    res = "icon-remove-sign";
                    break;
                case Icon.OkSign:
                    res = "icon-ok-sign";
                    break;
                case Icon.QuestionSign:
                    res = "icon-question-sign";
                    break;
                case Icon.InfoSign:
                    res = "icon-info-sign";
                    break;
                case Icon.Screenshot:
                    res = "icon-screenshot";
                    break;
                case Icon.RemoveCircle:
                    res = "icon-remove-circle";
                    break;
                case Icon.OkCircle:
                    res = "icon-ok-circle";
                    break;
                case Icon.BanCircle:
                    res = "icon-ban-circle";
                    break;
                case Icon.ArrowLeft:
                    res = "icon-arrow-left";
                    break;
                case Icon.ArrowRight:
                    res = "icon-arrow-right";
                    break;
                case Icon.ArrowUp:
                    res = "icon-arrow-up";
                    break;
                case Icon.ArrowDown:
                    res = "icon-arrow-down";
                    break;
                case Icon.ShareAlt:
                    res = "icon-share-alt";
                    break;
                case Icon.ResizeFull:
                    res = "icon-resize-full";
                    break;
                case Icon.ResizeSmall:
                    res = "icon-resize-small";
                    break;
                case Icon.Plus:
                    res = "icon-plus";
                    break;
                case Icon.Minus:
                    res = "icon-minus";
                    break;
                case Icon.Asterisk:
                    res = "icon-asterisk";
                    break;
                case Icon.ExclamationSign:
                    res = "icon-exclamation-sign";
                    break;
                case Icon.Gift:
                    res = "icon-gift";
                    break;
                case Icon.Leaf:
                    res = "icon-leaf";
                    break;
                case Icon.Fire:
                    res = "icon-fire";
                    break;
                case Icon.EyeOpen:
                    res = "icon-eye-open";
                    break;
                case Icon.EyeClose:
                    res = "icon-eye-close";
                    break;
                case Icon.WarningSign:
                    res = "icon-warning-sign";
                    break;
                case Icon.Plane:
                    res = "icon-plane";
                    break;
                case Icon.Calendar:
                    res = "icon-calendar";
                    break;
                case Icon.Random:
                    res = "icon-random";
                    break;
                case Icon.Comment:
                    res = "icon-comment";
                    break;
                case Icon.Magnet:
                    res = "icon-magnet";
                    break;
                case Icon.ChevronUp:
                    res = "icon-chevron-up";
                    break;
                case Icon.ChevronDown:
                    res = "icon-chevron-down";
                    break;
                case Icon.Retweet:
                    res = "icon-retweet";
                    break;
                case Icon.ShoppingCart:
                    res = "icon-shopping-cart";
                    break;
                case Icon.FolderClose:
                    res = "icon-folder-close";
                    break;
                case Icon.FolderOpen:
                    res = "icon-folder-open";
                    break;
                case Icon.ResizeVertical:
                    res = "icon-resize-vertical";
                    break;
                case Icon.ResizeHorizontal:
                    res = "icon-resize-horizontal";
                    break;
                case Icon.Hdd:
                    res = "icon-hdd";
                    break;
                case Icon.Bullhorn:
                    res = "icon-bullhorn";
                    break;
                case Icon.Bell:
                    res = "icon-bell";
                    break;
                case Icon.Certificate:
                    res = "icon-certificate";
                    break;
                case Icon.ThumbsUp:
                    res = "icon-thumbs-up";
                    break;
                case Icon.ThumbsDown:
                    res = "icon-thumbs-down";
                    break;
                case Icon.HandRight:
                    res = "icon-hand-right";
                    break;
                case Icon.HandLeft:
                    res = "icon-hand-left";
                    break;
                case Icon.HandUp:
                    res = "icon-hand-up";
                    break;
                case Icon.HandDown:
                    res = "icon-hand-down";
                    break;
                case Icon.CircleArrowRight:
                    res = "icon-circle-arrow-right";
                    break;
                case Icon.CircleArrowLeft:
                    res = "icon-circle-arrow-left";
                    break;
                case Icon.CircleArrowUp:
                    res = "icon-circle-arrow-up";
                    break;
                case Icon.CircleArrowDown:
                    res = "icon-circle-arrow-down";
                    break;
                case Icon.Globe:
                    res = "icon-globe";
                    break;
                case Icon.Wrench:
                    res = "icon-wrench";
                    break;
                case Icon.Tasks:
                    res = "icon-tasks";
                    break;
                case Icon.Filter:
                    res = "icon-filter";
                    break;
                case Icon.Briefcase:
                    res = "icon-briefcase";
                    break;
                case Icon.Fullscreen:
                    res = "icon-fullscreen";
                    break;
                case Icon.Default:
                    res = "";
                    break;
                default:
                    res = "";
                    break;
            }

            return res;
        }
    }
}
